package com.wiscamp.ninechapters.accounts.enums;

/**
 * 账户类型
 */
public enum AccountTypeEnum {
    POINTS(100, "积分账户"),

    VIRTUAL_MONEY(200, "虚拟币账户");

    private int value;

    private String name;

    AccountTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static AccountTypeEnum valueOf(int value) {
        switch (value) {
            case 100:
                return AccountTypeEnum.POINTS;
            case 200:
                return AccountTypeEnum.VIRTUAL_MONEY;
            default:
                return null;
        }
    }
}
